function Camera(infos)
{
	this.orientation = new Object();
	this.position = new Float32Array(3);
	this.infos = new Object();

	this.infos.vMatrix = infos[0];
	this.infos.sProgram = infos[1];
	this.infos.uLocation = infos[2];
}

Camera.prototype.calculatePosition = function()
{
	mat4.translate(this.infos.vMatrix, this.position);
}

Camera.prototype.calculateOrientation = function()
{

	var qp = quat4.createFromAxis(this.orientation.phi, [0.0, 1.0, 0.0]);
	var qt = quat4.createFromAxis(this.orientation.theta, [1.0, 0.0, 0.0]);

	var qr = quat4.multiply(qp, qt);
	quat4.toMat4(qr, this.infos.vMatrix);
}

Camera.prototype.setPosition = function(x, y, z)
{
	this.position[0] = x;
	this.position[1] = y;
	this.position[2] = z;
}

Camera.prototype.setOrientation = function(phi, theta)
{
	this.orientation.phi = phi;
	this.orientation.theta = theta;
}

Camera.prototype.cumulOrientation = function(phi, theta)
{
	this.orientation.phi += phi;
	this.orientation.theta += theta;
}

Camera.prototype.updateTranformation = function()
{
	this.calculateOrientation();
	this.calculatePosition();
	this.applyMatrix();
}

Camera.prototype.applyMatrix = function()
{
	var uv = gl.getUniformLocation(this.infos.sProgram, this.infos.uLocation);
	gl.uniformMatrix4fv(uv, false, this.infos.vMatrix);
}
